package cn.com.taiji.pos.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.github.dreamyoung.mprelation.EntityMapper;
import com.github.dreamyoung.mprelation.JoinColumn;
import com.github.dreamyoung.mprelation.OneToOne;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 卡片信息
 * </p>
 *
 * @author
 * @since 2021-03-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class CardInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId("ID")
    private String id;

    /**
     * 所属顾客
     */
    @TableField("CUSTOMER_ID")
    private String customerId;
    @TableField(exist = false)
    @EntityMapper
    @OneToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "id")
    private CardCustomer customer;

    /**
     * 卡片类型
     */
    @TableField("CARD_TYPE_ID")
    private String cardTypeId;

    /**
     * 卡片串号
     */
    @TableField("CARD_CODE")
    private String cardCode;

    /**
     * 卡片编号
     */
    @TableField("CARD_NO")
    private String cardNo;

    /**
     * 卡押金
     */
    @TableField("CASH_PLEDGE")
    private BigDecimal cashPledge;

    /**
     * 相关描述
     */
    @TableField("DESCRIPTION")
    private String description;

    /**
     * 是否可读写(0:不可1:可) 可读卡片唯一
     */
    @TableField("CAN_READ_WRITE")
    private String canReadWrite;

    /**
     * 存储格式
     */
    @TableField("STORAGE_FORMAT")
    private String storageFormat;

    /**
     * 状态(0:启用,1:停用,2:退卡)
     */
    @TableField("STATUS")
    private String status;

    /**
     * 创建人
     */
    @TableField("CREATOR_ID")
    private String creatorId;

    /**
     * 创建人姓名
     */
    @TableField("CREATOR_NAME")
    private String creatorName;

    /**
     * 创建时间
     */
    @TableField("CREATE_TIME")
    private LocalDateTime createTime;

    @TableField("HAND")
    private String hand;

    @TableField("WHOIS")
    private String whois;


}
